home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / turble.arc / TURBLE.REF < prev    next >
Text File  |  1986-03-31  |  9KB  |  241 lines

  1.                Constants You Can Use in Turble Graphics
  2.  
  3. Colors
  4.      
  5.      Name                 Value    Comment
  6.      ----                 -----    -------
  7.      None                    99    Turble
  8.      On                       1
  9.      Off                      0
  10.      Black                    0    Turbo
  11.      Blue                     1
  12.      Green                    2
  13.      Cyan                     3
  14.      Red                      4
  15.      Magenta                  5
  16.      Brown                    6
  17.      LightGray                7
  18.      DarkGray                 8
  19.      LightBlue                9
  20.      LightGreen              10
  21.      LightCyan               11
  22.      LightRed                12
  23.      LightMagenta            13
  24.      Yellow                  14
  25.      White                   15
  26.  
  27. Modes
  28.  
  29.      BW40                     0     Turbo
  30.      C40                      1
  31.      BW80                     2
  32.      C80                      3
  33.      MR                       4     Turble
  34.      CMR                      5
  35.      MRC                      5
  36.      HR                       6
  37.  
  38. Intersect Operators (for Get)
  39.  
  40.      A                        1     (AND)                  
  41.      O                        2     (OR)                   
  42.      X                        3     (XOR)                  
  43.      N                        4     (NOT)                  
  44.      E                        5     (EQUAL)                
  45.      B                        6     (BLANK)                
  46.                              
  47. Miscellaneous
  48.  
  49.      Circumference          360
  50.      HalfCircumference      180
  51.  
  52.  
  53.  
  54.                    Constants Used by Turble Graphics
  55.            (You can use them but you probably won't want to.)
  56.  
  57.      Name                 Value   
  58.      ----                 -----
  59.      ScrunchUp     User-defined     (Use variable Scrunch instead)
  60.  
  61.      HiXMax                 640     (Use functions XMax and YMax instead)
  62.      HiYMax        User-defined
  63.  
  64.      SegEven              $b800
  65.      SegOdd               $ba00
  66.      LineBytes              $50
  67.  
  68.  
  69.  
  70.                Functions You Can Use in Turble Graphics
  71.  
  72.       Name and Type                    Description
  73.       -------------                    -----------
  74.       XMax : Integer;                  Maximum values for X and Y
  75.       YMax : Integer;
  76.  
  77.       ColorDot(X,Y) : Byte;            Color of specified dot
  78.                                                 
  79.  
  80.              Global Variables Available in Turble Graphics
  81.  
  82.       Name and Type                    Description
  83.       -------------                    -----------
  84.       ColorOfPen      : Integer        Color of pen...
  85.       ColorOfBack     : Integer              ...background...
  86.       PaletteColors   : Integer              ...and palette.
  87.  
  88.       PenDown         : Boolean        Flags for pen active...
  89.       ColorIsOn       : Boolean               ...color on...
  90.       ResolutionHigh  : Boolean               ...and high resolution
  91.  
  92.       TurtleAngle     : Integer        Angle in which turtle points
  93.  
  94.       StartX          : Integer        Starting points for X and Y
  95.       StartY          : Integer           (updated constantly)
  96.  
  97.       CenterX         : Integer        Center points for X and Y
  98.       CenterY         : Integer           (always the same)
  99.  
  100.       Scrunch         : Real           Number for adjusting height
  101.  
  102.  
  103.  
  104.                 Procedures Available in Turble Graphics
  105.  
  106.       Name and Type                    Description
  107.       -------------                    -----------
  108.       PenColor(Color  : Integer)       Sets the color...
  109.       BackColor(Color : Integer)             ...background...
  110.       Palettor(Number : Integer)             ...or pallete.
  111.  
  112.       InitTurtle                       Sets or resets all defaults.
  113.  
  114.       Mode(Setting : Integer)          Sets the mode and calls InitTurtle.
  115.  
  116.       Dot(X,Y : Integer)               Draws an adjusted dot of PenColor.
  117.       Line(X1,Y1,X2,Y2 : Integer)      Draws an adjusted line of PenColor.
  118.  
  119.       Turn(Angle : Integer)            Turns the angle (relative).
  120.       TurnTo(Angle : Integer)          Turns the angle (absolute).
  121.  
  122.       Go(Distance : Integer)           Moves distance at default angle, 
  123.                                        drawing as it goes.
  124.  
  125.       MoveTo(X,Y : Integer)            Moves to absolute position, 
  126.                                        drawing as it goes.
  127.  
  128.       Poly(Number,Sides : Integer)     Draws polygon. 
  129.  
  130.       Tree(Height : Real)              Draws tree.
  131.  
  132.       Spiral(Side,Angle,Increment : Integer)      Draws spiral.
  133.       InSpiral(Side,Angle,Increment : Integer)    Draws inverted spiral.
  134.  
  135.       SnowFlake(Size,Level : Real)     Draws snowflake.
  136.  
  137.       LCircle(Radius : Integer)        Draws a left circle using Turble.
  138.       RCircle(Radius : Integer)        Draws a right circle using Turble.
  139.       CCircle(Radius : Integer)        Draws a centered circle using Turble.
  140.       Circle(Radius  : Integer)        Draws a circle by plotting each point.
  141.  
  142.       Slinky(Size,Bend : Integer)      Draws a series of circles.
  143.  
  144.       Paint(X,Y,Border,Color : Integer)
  145.                                        Paints a figure.  X,Y are the
  146.                                        starting points.  Border is the
  147.                                        color of the border and color is
  148.                                        the color of the paint.
  149.  
  150.                  Tips on Using Get and Put Procedures
  151.  
  152.    Here is the syntax for the get and put procedures:
  153.  
  154.       Get(StartWidth,StartHeight,Width,Height : Integer;
  155.                                     var AName : Storage;
  156.                                         FName : Strng;
  157.  
  158.                                        Gets a figure from the screen and 
  159.                                        puts it in memory and, optionally,
  160.                                        onto the screen.
  161.  
  162.       Put(var AName : Storage; StartWidth, StartHeight : Integer;
  163.                                               Operator : Byte;
  164.                                                  FName : Strng)
  165.  
  166.                                        Puts a figure from the memory or a 
  167.                                        file onto the screen.
  168.  
  169.    The Get and Put procedures use the following global type 
  170.    declaration. 
  171.    
  172.        Type
  173.          Strng   = String[14];     
  174.          Storage = Record
  175.                      Pixels : Array[1..MaxArray] of Byte;
  176.                      StoreHeight : Integer;
  177.                      StoreWidth  : Integer;
  178.                    end;
  179.    
  180.    They also use the constant:
  181.  
  182.        Const
  183.          MaxArray = 3000;
  184.  
  185.    You can increase MaxArray for large figures or decrease it for
  186.    small ones.  The array must be at least the size of the Height 
  187.    times the Width divided by eight for high resolution or four for 
  188.    medium resolution. 
  189.  
  190.    Before using GET, you must declare a variable of type Storage that 
  191.    you will use to name the figure you want to move.  Later you will
  192.    use the same name to Put the figure.  For example: 
  193.    
  194.        Var
  195.          Box : Storage;
  196.        
  197.        Get(1,1,50,50,Box,'');
  198.        Put(Box,150,150,e,'');
  199.    
  200.    This gets a square 50 by 50 starting at 1,1.  It stores the figure 
  201.    in Box.  Then Put takes the figure out of Box and puts it onto the 
  202.    screen at 150,150.  The operator "e" indicates that the new figure 
  203.    overwrites anything that was there before.  The empty set indicates
  204.    that the whole process takes place in memory.  
  205.  
  206.     
  207.    If you wanted Box to be saved in a file, you could do it like this: 
  208.  
  209.        Var
  210.          Box : Storage;
  211.        
  212.        Get(1,1,50,50,Box,'BOX.FIG');
  213.    
  214.    Then you could get the figure from the file even after booting (or
  215.    from another program) with this command:
  216.    
  217.        Var
  218.          Box : Storage;
  219.     
  220.        Put(Box,150,150,e,'BOX.FIG');
  221.  
  222.    The syntax may be confusing.  Get gets the figure from the screen 
  223.    and places it in memory and, optionally, in a file.  Put takes the 
  224.    figure out of memory or a file and puts it on the screen.  When 
  225.    using a file, you only have to Get or Put from the file once.  
  226.    After the first time the figure is in memory ready for use.
  227.  
  228.    You can declare several different figures and move them all in
  229.    different combinations.
  230.  
  231.        Var
  232.          Box    : Storage;
  233.          Circle : Storage;
  234.  
  235.        Get(1,1,50,50,Box,'');
  236.        Get(1,1,50,150,Circle,'');
  237.        Put(Circle,150,150,x,'');
  238.        Put(Box,150,150,x,'');
  239.  
  240. 
  241.